package com.gzhryc.shared_device.cdb.core.enums;

public enum ECDBLeaseResultCode {

    Success(1, "成功"), Fail(2, "失败"), NotRemoved(3, "未取出"), LockException(4, "锁异常")
    , Working(5, "工作中"), Overtime(6, "租借超时"), DeviceCheck(7, "设备自检")
    , NotAutomatic(101,"不支持自主租借");

    private Integer index;
    private String note;

    ECDBLeaseResultCode(Integer index, String note) {
        this.index = index;
        this.note = note;
    }

    public Integer index() {
        return index;
    }

    public String note() {
        return note;
    }

    public static String note(Integer index) {
        ECDBLeaseResultCode[] temp = ECDBLeaseResultCode.values();
        for (int i = 0; i < temp.length; i++) {
            ECDBLeaseResultCode item = temp[i];
            if (item.index.equals(index)) {
                return item.note;
            }
        }
        return null;
    }
}
